﻿using System;
using System.Collections.Generic;

namespace Microsoft.WowAddonStudio.TocEditor
{
	/// <summary>
	/// Encapsulates necessary information when the file list in the editor is changed.
	/// </summary>
	public sealed class FileListManagerEventArgs : EventArgs
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="FileListManagerEventArgs"/> class.
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="fileList">The file list.</param>
		/// <param name="selectedIndex">Index of the selected.</param>
		public FileListManagerEventArgs(IFileListManager sender, IList<IFileRepresentation> fileList,
		                                int selectedIndex)
		{
			if (sender == null)
				throw new ArgumentException("sender");

			if (fileList == null)
				throw new ArgumentException("fileList");

			Sender = sender;
			FileList = fileList;
			SelectedIndex = selectedIndex;
		}

		/// <summary>
		/// Gets the sender.
		/// </summary>
		/// <value>The sender.</value>
		public IFileListManager Sender { get; private set; }

		/// <summary>
		/// Gets the file list.
		/// </summary>
		/// <value>The file list.</value>
		public IList<IFileRepresentation> FileList { get; private set; }

		/// <summary>
		/// Gets the index of the selected.
		/// </summary>
		/// <value>The index of the selected.</value>
		public int SelectedIndex { get; private set; }
	}
}